$(function () {
  // 判断token是否存在




  if (!sessionStorage.getItem('token')) {
    window.location.href = 'login.html'
  }
  $('.layui-layout-right #logout').on('click', function () {
    layui.layer.confirm('确定要退出吗？', {
        icon: 5,
        title: '提示',
      },
      function (index, layero) {
        layer.close(index);
        sessionStorage.removeItem('token')
        window.location.href = 'login.html'
      })

  })
})